<div class="lian_jin chantu layui-hide">
    <div class="men">
        <div class="xiaotit">产值情况</div>
        <div class="fen2 float-l wd50">
            <div>
                <span class="float-l" style="padding-bottom: 5px;font-weight: 700;padding-top: 12px">产值完成统计：</span>
                <span class="float-r" style="font-weight: 700;display: inline-block;width: 280px">
                    产值完成占比：<span class="fw700 colorlan" id="lian_jin_zong_wanbi" style="font-size: 26px">0 %</span>
                </span>
            </div>
            <div class="clear"></div>
            <div class="float-l wd50">
                <div class="chart" id="lian_chart_chanwan" style="height: 200px"></div>
            </div>
            <div class="float-l wd50" style="padding-top: 40px">
                <div class="float-r fangding" style="padding-left: 20px;padding-top: 5px;display: inline-block;width: 280px">
                    <span class="fanglan tuclr1"></span><span style="margin-left: 20px">计划总产值：<span id="lian_jin_zong_chanfee">0</span></span>
                </div> <div class="clear"></div>
                <div class="float-r fangding" style="padding-left: 20px;padding-top: 5px;display: inline-block;width: 280px">
                    <span class="fanglan tuclr2"></span><span style="margin-left: 20px">累计完成产值：<span id="lian_jin_zong_wanchan">0</span></span>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="fen1 float-l wd50">
            <div>
                <span class="float-l" style="padding: 12px 0 6px 15px;font-weight: 700;padding-top: 12px">工期情况：</span>
                <span class="float-r" style="font-weight: 700;">
                    已开工(天)：<span class="fw700 colorlan" id="lian_jin_zong_shijitian" style="font-size: 26px">0</span>
                </span>
            </div>
            <div class="clear"></div>
            <div class="bbfang float-l bbflv">
                <div style="margin-top: 16px">计划开始日期</div>
                <div class="fw700"><span id="lian_jin_zong_startdt"></span></div>
            </div>
            <div class="bbfang float-l bbfhuang">
                <div style="margin-top: 16px">计划结束日期</div>
                <div class="fw700"><span id="lian_jin_zong_enddt"></span></div>
            </div>
            <div class="clear"></div>
            <div style="padding-left: 15px">
                实时工期占比：<span id="lian_jin_zong_jinbi">0 %</span>
            </div>
            <div class="clear"></div>
        </div>

        <div class="clear" style="padding-top: 20px"></div>
    </div>

    <div class="xiaoxian"></div>
    <div class="men">
        <div class="xiaotit">进度分析</div>
        <div class="fen1 float-l wd50">
            <div class="fw700" style="">产值工期对比</div>
            <div style="margin-top: 20px">
                <div class="layui-progress layui-progress-big jindulan" lay-filter="lian_cheng_zong_wanbi" lay-showPercent="true">
                    <div class="layui-progress-bar jinduhuang" lay-percent="0%"></div>
                </div>
                <div style="margin-top: 10px"><span>产值完成比：</span><span id="lian_cheng_zong_wanbi">0 %</span></div>
            </div>
            <div style="margin-top: 20px">
                <div class="layui-progress layui-progress-big jindulan" lay-filter="lian_cheng_zong_jinbi" lay-showPercent="true">
                    <div class="layui-progress-bar jinduhuang" lay-percent="0%"></div>
                </div>
                <div style="margin-top: 10px"><span>实时工期占比：</span><span id="lian_cheng_zong_jinbi">0 %</span></div>
            </div>
        </div>
        <div class="fen1 float-l wd50">
            <div class="fw700" style="width: 160px;margin: 80px auto 0">
                <span class="float-l" style="padding-top: 11px">进度预警</span>
                <span class="float-r" style="font-size: 26px"><span id="lian_cheng_zong_jinyu"></span></span>
            </div>
        </div>
        <div class="clear"></div>
    </div>

</div>
<script>


    function func_lian_jin() {
        layui.use(['laytp', 'form', 'element'], function() {
            var form = layui.form, layer = layui.layer, element = layui.element;

            facade.ajax({url: ask_engin_cha_lian_jin,data:{enginid:param_enginid}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;

                    $("#lian_jin_zong_wanbi").html(data.zong_wanbi+' %');
                    $("#lian_jin_zong_chanfee").html(parseFormatNum(data.zong_chanfee));
                    $("#lian_jin_zong_wanchan").html(parseFormatNum(data.zong_wanchan));
                    lian_chart_chanwan('lian_chart_chanwan', data);

                    $("#lian_jin_zong_shijitian").html(data.zong_shijitian);
                    $("#lian_jin_zong_startdt").html(data.zong_startdt);
                    $("#lian_jin_zong_enddt").html(data.zong_enddt);
                    $("#lian_jin_zong_jinbi").html(data.zong_jinbi +' %');


                    $("#lian_cheng_zong_wanbi").html(data.zong_wanbi+' %');
                    element.progress('lian_cheng_zong_wanbi', data.zong_wanbi+'%');
                    $("#lian_cheng_zong_jinbi").html(data.zong_jinbi+' %');
                    element.progress('lian_cheng_zong_jinbi', data.zong_jinbi+'%');


                    if(data.zong_jinyu == '正常'){
                        $("#lian_cheng_zong_jinyu").html(data.zong_jinyu).addClass('colorlan');
                    }else{
                        $("#lian_cheng_zong_jinyu").html(data.zong_jinyu).addClass('colorhong');
                    }


                }
            });
        });
    }

    function lian_chart_chanwan(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();

        option = {
            color: [colors[1], colors[2]],
            backgroundColor: '#FFFFFF',
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c}'
            },
            grid: {
                top: '1px',
                bottom: '1px',
                left: '1px',
                right: '1px',
                containLabel: true
            },
            series: [
                {
                    name: '产值完成统计',
                    type: 'funnel',
                    left: 1,
                    top: 1,
                    bottom: 30,
                    width: '100%',
                    min: 0,
                    max: 100,
                    minSize: '0%',
                    maxSize: '100%',
                    sort: 'descending',
                    gap: 2,
                    label: {
                        show: true,
                        position: 'inside'
                    },
                    labelLine: {
                        length: 10,
                        lineStyle: {
                            width: 1,
                            type: 'solid'
                        }
                    },
                    itemStyle: {
                        borderColor: '#fff',
                        borderWidth: 1
                    },
                    emphasis: {
                        label: {
                            fontSize: 12
                        }
                    },
                    data: [
                        { value: data.zong_chanfee, name: '计划总产值' },
                        { value: data.zong_wanchan, name: '累计完成产值' },
                    ]
                }
            ]
        };
        mychat.setOption(option);
    }

</script>

